/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - Bool1
 * <p>Powered by webrx On 2021-11-22 14:05:58
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Bool2 {
    public static void main(String[] args) {
        int a = 1;
        int b = 3;
        //演示 || 短路
        if (a == 1 || ++b == 6) {
            System.out.println("ok");
            System.out.println(a);
            System.out.println(b);
        }

        //演示 && 短路 else 1 3   & 不短路  else 1 4
        if (a == 3 & ++b == 6) {
            System.out.println("ok");
            System.out.println(a);
            System.out.println(b);
        } else {
            System.out.println("else");
            System.out.println(a);
            System.out.println(b);
        }
    }
}
